package com.lagou.order.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.lagou.order.entity.Order;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 * 接口被seata管理. 根据事务的状态完成提交或回滚操作
 */
@LocalTCC
public interface OrderService extends IService<Order> {

    @TwoPhaseBusinessAction(name = "addTCC",
            commitMethod = "addCommit",rollbackMethod = "addRollBack")
    void add(@BusinessActionContextParameter(paramName = "order") Order order);

    public boolean addCommit(BusinessActionContext context);


    public boolean addRollBack(BusinessActionContext context);

}
